package com.server.game;

import com.server.orm.OrmTransaction;

public class TransactionManager {

    private static TransactionManager instance = new TransactionManager();

    public static TransactionManager getInstance() {
        return instance;
    }

    private TransactionDispatcher transactionDispatcher = new TransactionDispatcher();

    public void init() {
        transactionDispatcher.startUp();
    }

    public void close() {
        transactionDispatcher.close();
    }

    /**
     * 将执行过程，放入异步执行队列
     */
    public void asyncAddOrmTransaction(OrmTransaction ormTransaction) {
        transactionDispatcher.addOrmTransaction(ormTransaction);
    }
}
